﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:shapes="clr-namespace:MiniUML.Plugins.UmlClassDiagram.Resources.Shapes">

    <!-- Uml.Associations.Inheritance -->
    <DataTemplate x:Key="Uml.Associations.Inheritance">
        <shapes:GenericUmlAssociation FromArrow=""
                                      ToArrow="Uml.Arrows.Triangle"
                                      Stroke="#716F64"
                                      FromName="{Binding Path='Attribute[From].Value'}"
                                      ToName="{Binding Path='Attribute[To].Value'}" />
    </DataTemplate>

    <!-- Uml.Associations.Association -->
    <DataTemplate x:Key="Uml.Associations.Association">
        <shapes:GenericUmlAssociation FromArrow="{Binding Path='Attribute[FromArrow].Value'}"
                                      ToArrow="{Binding Path='Attribute[ToArrow].Value', FallbackValue='Uml.Arrows.Arrow'}"
                                      Stroke="{Binding Path='Attribute[Stroke].Value', FallbackValue='#B0764F'}"
                                      FromName="{Binding Path='Attribute[From].Value'}"
                                      ToName="{Binding Path='Attribute[To].Value'}" />
    </DataTemplate>

    <!-- Uml.Arrows.Triangle -->
    <DataTemplate x:Key="Uml.Arrows.Triangle">
        <Canvas Height="0" Width="0">
            <Grid Canvas.Right="0" Canvas.Top="-20">
                <Grid.RowDefinitions>
                    <RowDefinition Height="20"/>
                    <RowDefinition Height="20"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition Width="15"/>
                </Grid.ColumnDefinitions>
                <Polyline Grid.Column="1" Grid.RowSpan="2"  Height="30"
                          VerticalAlignment="Center" HorizontalAlignment="Right" Fill="White" Style="{DynamicResource StrokeStyle}">
                    <Polyline.Points>
                        <Point X="0" Y="10"/>
                        <Point X="10" Y="15"/>
                        <Point X="0" Y="20"/>
                        <Point X="0" Y="10"/>
                    </Polyline.Points>
                </Polyline>
            </Grid>
        </Canvas>
    </DataTemplate>

    <!-- Uml.Arrows.Arrow -->
    <DataTemplate x:Key="Uml.Arrows.Arrow">
        <Canvas Height="0" Width="0">
            <Grid Canvas.Right="0" Canvas.Top="-20">
                <Grid.RowDefinitions>
                    <RowDefinition Height="20"/>
                    <RowDefinition Height="20"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition Width="15"/>
                </Grid.ColumnDefinitions>
                <Polyline Grid.Column="1" Grid.RowSpan="2" Height="30"
                          VerticalAlignment="Center" HorizontalAlignment="Right" Style="{DynamicResource StrokeStyle}">
                    <Polyline.Points>
                        <Point X="0" Y="10"/>
                        <Point X="10" Y="15"/>
                        <Point X="0" Y="20"/>
                    </Polyline.Points>
                </Polyline>
            </Grid>
        </Canvas>
    </DataTemplate>

</ResourceDictionary>